package com.hsxc.cdz.monitor.bean.second;

import com.hsxc.cdz.base.util.BytesUtil;

public class CP56Time2a {
	
	private int millisecond; //毫秒 两个字节的二进制毫秒时间 低字节在前
	private byte minutes;   //  分钟  低 6位有效
	private byte hours;     //  小时 低戚薇有效
	private byte day;       //  日期
	private byte month;     //  月
	private byte year;      //  年
	
	public static final int length = 7;
	/*********************************************************************/
	public CP56Time2a(byte[] data){
		setCP(data);
	}
	/********************************************************************/
	//转换报文的方法
	public byte[] getCP (){
		return null;
	}
	
	public boolean setCP (byte[] data){
		try{
			this.millisecond = BytesUtil.bytesToIntDesc(BytesUtil.getByte(0, 2, data));
			this.minutes = data[2];
			this.hours = data[3];
			this.day = data[4];
			this.month = data[5];
			this.year = data[6];
		}catch (Exception e){
			return false;
		}
		return true;
	}
	
	/*******************************************************************/
	//get() and set()
	public int getMillisecond() {
		return millisecond;
	}
	public void setMillisecond(int millisecond) {
		this.millisecond = millisecond;
	}
	public byte getMinutes() {
		return minutes;
	}
	public void setMinutes(byte minutes) {
		this.minutes = minutes;
	}
	public byte getHours() {
		return hours;
	}
	public void setHours(byte hours) {
		this.hours = hours;
	}
	public byte getDay() {
		return day;
	}
	public void setDay(byte day) {
		this.day = day;
	}
	public byte getMonth() {
		return month;
	}
	public void setMonth(byte month) {
		this.month = month;
	}
	public byte getYear() {
		return year;
	}
	public void setYear(byte year) {
		this.year = year;
	}
 }
